package com.xiexie.stock.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Date 2022-04-07 14:48
 * @Author xie
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Value("${server.port}")
    private String port;

    @RequestMapping("/reduct")
    public String reduct() {
        System.out.println("扣减库存");
        return "扣减库存成功 " + port;
    }

    @RequestMapping("/{id}")
    public String get(@PathVariable Integer id) {
        return "查询商品id=" + id + " port=" + port;
    }
}
